<template>
  <div>
    <div v-for="i in this.dataList" :key="i.index">
      <!-- //content为需要渲染的字符串数据 -->
      <div style="white-space: pre-wrap; margin: 10px" v-html="i.remark"></div>
    </div>
    <div v-if="this.dataList.length === 0">
      <div style="margin: 0; text-align: center;height: 200px;line-height:200px">暂无数据</div>
    </div>
  </div>
</template>
<script>
// import { baseLogList } from '@/views/PurchaseOrder/api/delivery'
export default {
  props: ['serviceId', 'serviceType'],
  data() {
    return {
      dataList: []
    }
  },
  watch: {
    serviceId: {
      handler(v) {
        if (v) {
          this.$nextTick(() => {
            this.getData()
          })
        }
      },
      immediate: true
    }
  },
  methods: {
    getData() {
      const params = {
        serviceId: this.serviceId,
        serviceType: this.serviceType,
        pageSize: '100000',
        pageNum: '1'
      }
      baseLogList(params).then(res => {
        this.dataList = res.data.list.map(r => {
          if (r.remark) {
            r.remark = r.remark.replace(/\r\n/g, '</br>')
          }
          return r
        })
      })
    }
  }
}
</script>
